<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="env(VAR_DUMPER_SERVER)">127.0.0.1:9912</parameter>
    </parameters>

    <services>
        <defaults public="false" />

        <service id="twig.extension.dump" class="Symfony\Bridge\Twig\Extension\DumpExtension">
            <tag name="twig.extension" />
            <argument type="service" id="var_dumper.cloner" />
            <argument type="service" id="var_dumper.html_dumper" />
        </service>

        <service id="data_collector.dump" class="Symfony\Component\HttpKernel\DataCollector\DumpDataCollector" public="true">
            <tag name="data_collector" id="dump" template="@Debug/Profiler/dump.html.twig" priority="240" />
            <argument type="service" id="debug.stopwatch" on-invalid="ignore" />
            <argument type="service" id="debug.file_link_formatter" on-invalid="ignore"></argument>
            <argument>%kernel.charset%</argument>
            <argument type="service" id="request_stack" />
            <argument>null</argument><!-- var_dumper.cli_dumper or var_dumper.server_connection when debug.dump_destination is set -->
        </service>

        <service id="debug.dump_listener" class="Symfony\Component\HttpKernel\EventListener\DumpListener">
            <tag name="kernel.event_subscriber" />
            <argument type="service" id="var_dumper.cloner" />
            <argument type="service" id="var_dumper.cli_dumper" />
            <argument>null</argument>
        </service>

        <service id="var_dumper.cloner" class="Symfony\Component\VarDumper\Cloner\VarCloner" public="true" />
        <service id="var_dumper.cli_dumper" class="Symfony\Component\VarDumper\Dumper\CliDumper">
            <argument>null</argument><!-- debug.dump_destination -->
            <argument>%kernel.charset%</argument>
            <argument>0</argument> <!-- flags -->
        </service>

        <service id="var_dumper.contextualized_cli_dumper" class="Symfony\Component\VarDumper\Dumper\ContextualizedDumper" decorates="var_dumper.cli_dumper">
            <argument type="service" id="var_dumper.contextualized_cli_dumper.inner" />
            <argument type="collection">
                <argument type="service" key="source">
                    <service class="Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider">
                        <argument>%kernel.charset%</argument>
                        <argument type="string">%kernel.project_dir%</argument>
                        <argument type="service" id="debug.file_link_formatter" on-invalid="null" />
                    </service>
                </argument>
            </argument>
        </service>

        <service id="var_dumper.html_dumper" class="Symfony\Component\VarDumper\Dumper\HtmlDumper">
            <argument>null</argument>
            <argument>%kernel.charset%</argument>
            <argument>0</argument> <!-- flags -->
            <call method="setDisplayOptions">
                <argument type="collection">
                    <argument key="fileLinkFormat" type="service" id="debug.file_link_formatter" on-invalid="ignore"></argument>
                </argument>
            </call>
        </service>

        <service id="var_dumper.server_connection" class="Symfony\Component\VarDumper\Server\Connection">
            <argument /> <!-- server host -->
            <argument type="collection">
                <argument type="service" key="source">
                    <service class="Symfony\Component\VarDumper\Dumper\ContextProvider\SourceContextProvider">
                        <argument>%kernel.charset%</argument>
                        <argument type="string">%kernel.project_dir%</argument>
                        <argument type="service" id="debug.file_link_formatter" on-invalid="null" />
                    </service>
                </argument>
                <argument type="service" key="request">
                    <service class="Symfony\Component\VarDumper\Dumper\ContextProvider\RequestContextProvider">
                        <argument type="service" id="request_stack" />
                    </service>
                </argument>
                <argument type="service" key="cli">
                    <service class="Symfony\Component\VarDumper\Dumper\ContextProvider\CliContextProvider" />
                </argument>
            </argument>
        </service>

        <service id="var_dumper.dump_server" class="Symfony\Component\VarDumper\Server\DumpServer">
            <argument /> <!-- server host -->
            <argument type="service" id="logger" on-invalid="null" />
            <tag name="monolog.logger" channel="debug" />
        </service>

        <service id="var_dumper.command.server_dump" class="Symfony\Component\VarDumper\Command\ServerDumpCommand">
            <argument type="service" id="var_dumper.dump_server" />
            <argument type="collection">
                <argument type="service" key="cli">
                    <service class="Symfony\Component\VarDumper\Command\Descriptor\CliDescriptor">
                        <argument type="service" id="var_dumper.contextualized_cli_dumper.inner" />
                    </service>
                </argument>
                <argument type="service" key="html">
                    <service class="Symfony\Component\VarDumper\Command\Descriptor\HtmlDescriptor">
                        <argument type="service" id="var_dumper.html_dumper" />
                    </service>
                </argument>
            </argument>
            <tag name="console.command" command="server:dump" />
        </service>

        <service id="monolog.command.server_log" class="Symfony\Bridge\Monolog\Command\ServerLogCommand">
            <tag name="console.command" command="server:log" />
        </service>
    </services>
</container>
